package name.jiaosha.air.iostorage.domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.ali8ba.Domain;
import com.ali8ba.common.JsonDateSerializer;

/**
 * 采购表(只当入库记录)
 * 
 * @author xu
 * 
 */
@Entity
@Table(name = "buy")
public class Buy extends Domain {

	private static final long serialVersionUID = 5302555070769418894L;
	/**
	 * 单据号
	 */
	@Id()
	@Column(name = "docid")
	private String docID;
	/**
	 * 销售单位
	 */
	@Column(name="partnerId")
	private Integer partnerId;
	/**
	 * 该张单据总额
	 */
	@Column(name="totalAmount")
	private BigDecimal totalAmount;
	/**
	 * 备注
	 */
	@Column(name="remarks")
	private String remarks;
	/**
	 * 购买日期
	 */
	
	@Column(name="buyDate")
	private Date buyDate;
	/**
	 * 经手人
	 */
	@Column(name="handler")
	private String handler;
	/**
	 * 录入人
	 */
	@Column(name="createMan")
	private String createMan;
	/**
	 * 录入日期
	 */
	@Column(name="createTime")
	private Date createTime;
	/**
	 * 审核人
	 */
	@Column(name="auditor")
	private String auditor;
	/**
	 * 审核时间
	 */
	@Column(name="auditTime")
	private Date auditTime;
	/**
	 * 状态
	 */
	@Column(name="state")
	private int state;
	
	@Transient
	private List<BuyItem> items=new ArrayList<BuyItem>();

	public Buy() {

	}

	public String getDocID() {
		return docID;
	}

	public void setDocID(String docID) {
		this.docID = docID;
	}

	public Integer getPartnerId() {
		return partnerId;
	}

	public void setPartnerId(Integer partnerId) {
		this.partnerId = partnerId;
	}

	public BigDecimal getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(BigDecimal totalAmount) {
		this.totalAmount = totalAmount;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getBuyDate() {
		return buyDate;
	}

	public void setBuyDate(Date buyDate) {
		this.buyDate = buyDate;
	}

	public String getHandler() {
		return handler;
	}

	public void setHandler(String handler) {
		this.handler = handler;
	}

	public String getCreateMan() {
		return createMan;
	}

	public void setCreateMan(String createMan) {
		this.createMan = createMan;
	}
	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getAuditor() {
		return auditor;
	}

	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}

	public Date getAuditTime() {
		return auditTime;
	}
	@JsonSerialize(using = JsonDateSerializer.class)
	public void setAuditTime(Date auditTime) {
		this.auditTime = auditTime;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	@Transient
	public List<BuyItem> getItems() {
		return items;
	}

	public void setItems(List<BuyItem> items) {
		this.items = items;
	}

	
	
}
